﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using PolarExpress.Model.Interfaces;

using StandardFramework;
using Serialization;
using DependencyInjection;

namespace PolarExpress.Model
{
    public class Project : IProject
    {
        private BaseComponentPool _componentPool = new BaseComponentPool();

        public BaseComponentPool ComponentPool
        {
            get { return _componentPool; }
            set { _componentPool = value; }
        }

        private string _filename;

        private ISerializer _serializer;

        [Inject]
        public Project(ISerializer serializer)
        {
            _serializer = serializer;
        }

        public void Add(BaseComponent component)
        {
            _componentPool.Add(component);
            OnModelChanged();
        }

        public void Save(string filename)
        {

        }

        public void Load(string filename)
        {

        }

        public event ModelChangedHandler ModelChanged;

        private void OnModelChanged()
        {
            if (ModelChanged != null)
                ModelChanged(this, new ModelChangedEventArgs(this));
        }
    }
}
